﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class Result
{
    public const string OK = "{\"errcode\":\"0\",\"errmsg\":\"ok\" }";

    public static string Error(string errmsg)
    {
        return "{\"errcode\":\"1\",\"errmsg\":\"" + errmsg + "\" }";
    }
    public static string Error(string errcode, string errmsg)
    {
        return "{\"errcode\":\"" + errcode + "\",\"errmsg\":\"" + errmsg + "\" }";
    }

    public static string Return(string result)
    {
        Json r = new Json();
        r["errcode"] = "0";
        r["errmsg"] = "ok";
        r["result"] = result;
        return r;
    }

}